home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F40906_salesMap.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  1.5 KB  |  45 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xalan="http://xml.apache.org/xalan"
  4. xmlns:test-map-product="test-map-product"
  5. exclude-result-prefixes="xsl xalan test-map-product"
  6. >
  7.    <xsl:import href="sum.xsl"/>
  8.    <xsl:import href="map.xsl"/>
  9.    <xsl:import href="product.xsl"/>
  10.  
  11.    <!-- This transformation is to be applied on:
  12.         salesMap.xml
  13.         
  14.         It contains the code of the "some of products" from the 
  15.         article "The Functional Programming Language XSLT"
  16.      -->
  17.  
  18.    <test-map-product:test-map-product/>
  19.    
  20.    <xsl:output method="text"/>
  21.  
  22.    <xsl:template match="/">
  23.      <!-- Get: map product /sales/sale -->
  24.      <xsl:variable name="vSalesTotals">
  25.          <xsl:variable name="vTestMap" select="document('')/*/test-map-product:*[1]"/>
  26.          <xsl:call-template name="map">
  27.            <xsl:with-param name="pFun" select="$vTestMap"/>
  28.            <xsl:with-param name="pList1" select="/sales/sale"/>
  29.          </xsl:call-template>
  30.      </xsl:variable>
  31.  
  32.      <!-- Get sum map product /sales/sale -->
  33.       <xsl:call-template name="sum">
  34.         <xsl:with-param name="pList" select="xalan:nodeset($vSalesTotals)/*"/>
  35.       </xsl:call-template>
  36.    </xsl:template>
  37.  
  38.     <xsl:template name="makeproduct" match="*[namespace-uri() = 'test-map-product']">
  39.       <xsl:param name="arg1"/>
  40.  
  41.       <xsl:call-template name="product">
  42.         <xsl:with-param name="pList" select="$arg1/*"/>
  43.       </xsl:call-template>
  44.     </xsl:template>
  45. </xsl:stylesheet>